#ifndef COMPLEX_H
#define COMPLEX_H
#include <iostream>

class Complex
{
private:
     int real, imag;
public:

    Complex(int r = 0, int i = 0);

    Complex& operator+(Complex const &obj){

        this->real = this ->real + obj.real;
        this->imag = this ->imag + obj.imag;
        return*this;
}
    Complex& operator-(Complex const &obj){

        this->real = this ->real - obj.real;
        this->imag = this ->imag - obj.imag;
        return*this;
}

    Complex& operator*(Complex const &obj){

        this->real = this ->real * obj.real;
        this->imag = this ->imag * obj.imag;
        return*this;
}
    void print(){std::cout << real << "+" << imag << "i" << std::endl;}

}; //类定义后的分号不能丢了！

#endif // COMPLEX_H
